const mysql = require("mysql"); // 连接mysql
const co = require("co-mysql"); // 封装了promise的myql操作
const config = require("../config");

//连接池
const db = mysql.createPool({
  host: config.DB_HOST,
  user: config.DB_USER,
  password: config.DB_PASS,
  database: config.DB_NAME
});

module.exports = co(db);
